package com.miyake.server.dsaccess;

import java.util.List;

import javax.jdo.PersistenceManager;

import com.miyake.server.PMF;

public class FindSomething<T> {
	private List<T> list;
	
	public FindSomething(String nodeKey, String className) {
		PersistenceManager pm = PMF.get().getPersistenceManager();
		try {
			String query = "select from " + className;
			list = (List<T>) pm.newQuery(query).execute();
			for (T t : list) {
				System.out.println(t.toString());
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		finally {
			pm.close();
		}	
	}
	
	public List<T> getList() {
		return list;
	}
	
}
